$(function () {
    getRoomPicture();
});

function getRoomPicture() {
    let result = myAjax('/getRoomPicture', 'post', {});
    let data = result.list;
    let html = "";
    for (let i = 0; i < data.length; i++) {
        html += ' <li onclick="picture(' + data[i].roomId + ')">\n' +
            '     <img src="' + data[i].roomPhoto + '"/>\n' +
            '     <div>' + data[i].roomTitle + '</div>\n' +
            '     </li>';
    }
    $("#imgList").html(html);
}

function picture(data) {
    localStorage.setItem("temp", data);
    //sessionStorage.setItem("userId",id);   本地存储  两种方式都可以
    window.open("/html/roomDetails.html");//在新窗口页面跳转
    // location.assign("/html/roomDetails.html");//在当前页面进行跳转
}